function mode_searchclass(){
	$('#reim_keysou').keyup(function(){reim.searchss();});
	$('#reim_keysou').click(function(){reim.searchss();});
	
	var c={
		searchss:function(){
			clearTimeout(this.searchsstime);
			this.searchsstime=setTimeout('reim.searchssss()',500);
			if(!this.searchright)this.searchright=$.rockmenu({
				data:[],iconswh:20,width:190,
				itemsclick:function(d){
					reim.searchclick(d);
				}
			});
		},
		searchclick:function(d){
			var ty = d.type;
			if(ty=='user')this.showuserinfo(d.xuoi);
			if(ty=='group')this.opengroup(d.id);
			if(ty=='agent')this.openagent(d.id,true);
		},
		searchssss:function(){
			var o = $('#reim_keysou'),val=strreplace(o.val());
			var d=[];
			if(val==''){
				this.searchright.hide();
				return;
			}
			
			var off=o.offset(),sid,a,s1,arr,i,oi=1;
			arr = this.useraarr;
			for(i=0;i<arr.length;i++){
				a=arr[i];
				if(a.name.indexOf(val)>-1 || (a.pingyin && a.pingyin.indexOf(val)==0) || (a.deptname && a.deptname.indexOf(val)>-1) || (a.position && a.position.indexOf(val)>-1)){
					s1=''+a.name+'<font color=#888888>('+a.position+')</font>';
					d.push({name:s1,id:a.id,icons:a.face,type:'user',xuoi:i});
					oi++;
				}
				if(oi>10)break;
			}
			arr = this.grouparr;
			for(i=0;i<arr.length;i++){
				a=arr[i];
				if(a.name.indexOf(val)>-1){
					s1=''+a.name+'<font color=#888888>(会话)</font>';
					d.push({name:s1,id:a.id,icons:a.picurl,type:'group'});
				}
			}
			arr = this.agentarr;
			for(i=0;i<arr.length;i++){
				a=arr[i];
				if(a.name.indexOf(val)>-1){
					s1=''+a.name+'<font color=#888888>(应用)</font>';
					d.push({name:s1,id:a.id,icons:a.face,type:'agent'});
				}
			}
			
			if(d.length==0){
				this.searchright.hide();
				return;
			}
			this.searchright.setData(d);
			this.searchright.showAt(off.left+1,off.top+31);
		}
	}

	return c;
}